﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NETDB;

public partial class mis_function_user_log_detail : BasePermissionPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (PreviousPage != null)
            {  
                lbl_dept.Text = PreviousPage.DeptName;
                lbl_YearMonth.Text = PreviousPage.FunctionDate;                
                lbl_user.Text = PreviousPage.UserName;
                lbl_FUNCTION_NAME.Text = PreviousPage.FunctionName;

                lbl_USER_ID.Text = PreviousPage.UserID;
                lbl_LOGIN_DATE.Text = PreviousPage.FunctionDate.Replace("/", "");
                lbl_FUNCTION_ID.Text = PreviousPage.FunctionID;
            }
        }

    }
    protected void btn_exit_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Management/System/mis_function_user_log.aspx");
    }
    protected void gv_login_log_RowDataBound(object sender, GridViewRowEventArgs e)
    {
         if (e.Row.RowType==DataControlRowType.DataRow)
        {
            Label lbl = e.Row.FindControl("lbl_LOGIN_DATE") as Label;
            lbl.Text = CommonUtil.TransferyyyyMMddToDate(lbl.Text);
        }
    }
    protected void btn_export_Click(object sender, EventArgs e)
    {
        btn_exit.Visible = false;
        btn_export.Visible = false;
        ExportUtil.ExportWebControlToExcel(DateTime.Now.ToString("yyyyMMdd-hhmmss-") + "FunctionDetailLog", PanelMain);
    }

    public override void VerifyRenderingInServerForm(Control control)
    {

    }
}